﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Channels;
using System.Threading.Tasks;
using ScottPlot;
namespace Daq.Services
{
    public enum PlotMessageType
    {
        RemoveSerie,
        AddSerie,
        ClearAllSeries,
    }

    public struct PlotMessage
    {
        public PlotMessageType Type;
        public string ChannelName;
        public double Value;
        public Color Color;
        public string Unit;
        public bool IsVisible;
    }

    public struct PlotDataMessage
    {
        public string ChannelName;
        public double Value;
        public double Average;
        public DateTime Time;
    }
    public class PlotService
    {
        public Channel<PlotMessage> CommandBuffer { get; set; } = Channel.CreateUnbounded<PlotMessage>();
        public Channel<PlotDataMessage> DataBuffer { get; set; } = Channel.CreateUnbounded<PlotDataMessage>();
    }
}
